<?php ob_start();
    //$make       = Model_Listing_Attribute::one(array('_id' => $this->listing->make));
    //$model      = Model_Listing_Attribute::one(array('_id' => $this->listing->model));
    $make         = $this->listing->make;
    $model        = $this->listing->model;
    $internal_lng = $this->listing->getInternalLanguage();
    $cat_search = $this->listing->category[0]->getParent();
    
?>
    <?php if (!empty($this->listing->make)) {
        $val = '<a href="'.Ac_Util::getCrossLink($this->listing->make->_id, 'make', $this->listing, '/search/regular') . '">'. $make->name . "</a>";
        echo $this->dtDd($this->t('Make', $internal_lng), $val, true, ' itemprop="brand"');
    }?>
    <?php if (!empty($this->listing->model)) {
    	$val = '<a href="'. Ac_Util::getCrossLink($this->listing->model->_id, 'model', $this->listing, '/search/regular'). '">'. $model->name . "</a>";
        echo $this->dtDd($this->t('Model', $internal_lng), $val, true, ' itemprop="model"');
    }?>
    <?php if (!empty($this->listing->displacement)) {
        echo $this->dtDd($this->t('Displacement', $internal_lng), $this->t('__1__ cc', $internal_lng, $this->listing->displacement), true);
    }?>
    <?php if (!empty($this->listing->yearmanufactured)) {
        echo $this->dtDd($this->t('Year Manufactured', $internal_lng), $this->listing->yearmanufactured, true);
    }?>

    <?php
    if (!empty($this->listing->cartype)) {
        $views = Model_Listing_Car::getCarType();
        //$val = '<a href="/search/regular?small_category_list=' . $cat_search->path[0] . '&cartype=' . $this->listing->cartype . '">'. $views[$this->listing->cartype] . "</a>";
        $val = '<a href="'. Ac_Util::getCrossLink($this->listing->cartype, 'cartype', $this->listing, '/search/regular') . '">'. $views[$this->listing->cartype] . "</a>";
        echo $this->dtDd($this->t('Car Type', $internal_lng), $val, true);
    }
    ?>
    <?php if (!empty($this->listing->numberpreviousowner)) {
        echo $this->dtDd($this->t('Number of previous owners', $internal_lng), $this->listing->numberpreviousowner, true);
    }?>
    
    <?php
    if (!empty($this->listing->doors)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getDoors();
        if (!empty($views[$this->listing->doors])) {
            echo $this->dtDd($this->t('Doors', $internal_lng), $this->t($views[$this->listing->doors], $internal_lng), true);
        }
    }
    ?>
    <?php
    if (!empty($this->listing->poweroptions)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getPowerOptions();
        $to_add     = '';
        foreach ((array)$this->listing->poweroptions as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Power Options', $internal_lng), $field, true);
    }
    ?>
    <?php
    if (!empty($this->listing->entertainmentfeatures)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getEntertComm();
        $to_add     = '';
        foreach ((array)$this->listing->entertainmentfeatures as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Entertainment Communication Features', $internal_lng), $field, true);
    }
    ?>
    <?php
    if (!empty($this->listing->interiorcolor)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getIntColor();
        $to_add     = '';
        foreach ((array)$this->listing->interiorcolor as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Interior Color', $internal_lng), $field, true);
    }
    ?>
    <?php
    if (!empty($this->listing->exteriorcolor)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getExtColor();
        $to_add     = '';
        foreach ((array)$this->listing->exteriorcolor as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Exterior Color', $internal_lng), $field, true);
    }
    ?>

    <?php
    if (!empty($this->listing->safetyfeatures)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getSafetyFeatures();
        $to_add     = '';
        foreach ((array)$this->listing->safetyfeatures as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Safety Features', $internal_lng), $field, true);
    }
    ?>
    <?php
    if (!empty($this->listing->drivetype)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getDriveType();
        echo $this->dtDd($this->t('Drive Type', $internal_lng), $this->t($views[$this->listing->drivetype], $internal_lng), true);
    }
    ?>
    <?php
    if (!empty($this->listing->engine)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getEngine();
        echo $this->dtDd($this->t('Engine', $internal_lng), $this->t($views[$this->listing->engine], $internal_lng, true));
    }
    ?>
    <?php if (!empty($this->listing->mileage)) {
        echo $this->dtDd($this->t('Mileage', $internal_lng), $this->t('__1__ km', $internal_lng, Ac_Util::abbreviation($this->listing->mileage)), true);
    }?>
    <?php
    if (!empty($this->listing->transmission)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getTransmission();
        echo $this->dtDd($this->t('Transmission', $internal_lng), $this->t($views[$this->listing->transmission], $internal_lng), true);
    }
    ?>
    <?php if (!empty($this->listing->horsepower)) {echo $this->dtDd($this->t('Horsepower'), $this->t('__1__ HP',null, $this->listing->horsepower));}?>
    <?php
    if (!empty($this->listing->fueleconomy)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getFuelEconomyPostAd();
        echo $this->dtDd($this->t('Fuel Economy', $internal_lng), $this->t($views[$this->listing->fueleconomy], $internal_lng), true);
    }
    ?>
    <?php
    if (!empty($this->listing->fuel)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Car::getFuel();
        echo $this->dtDd($this->t('Fuel', $internal_lng), $this->t($views[$this->listing->fuel], $internal_lng), true);
    }
    ?>
<?php $content = trim(ob_get_clean())?>
<?php if (!empty($content)):?>
<section class="category">
    <h3><?php echo $this->t('汽車資料', $internal_lng)?></h3>
    <?php echo $content ?>

</section>
<?php endif;?>
